|
|
|
|
|
|
|
Example program StyleBox, shown in Figure 1.21, demonstrates each of these drawing styles. |
|
|
|
|
|
|
|
|
Many applications combine DrawMode vbInvert with DrawStyle vbDot to produce dotted rubber-banding effects. Example program RubrBox, shown in Figure 1.22, uses this technique to let you to select a rectangle using the mouse. Click and drag to select a rectangle using a dotted rubber-band box. When you release the mouse, the program fills the box you selected with a random color. |
|
|
|
|
|
|
|
|
DrawWidth specifies how thick lines, circles, and points are drawn. |
|
|
|
|
|
|
|
|
Unfortunately, Visual Basic does not honor the DrawStyle property unless DrawWidth is 1. That means you cannot use DrawStyle to draw a thick dotted line. |
|
|
|
|
|
|
|
|
If you make DrawWidth greater than 1, Visual Basic treats vbDash, vbDot, vbDashDot, and vbDashDotDot as if they were vbSolid. It draws vbSolid and vbInvisible as you would expect, and it draws vbInsideSolid as if DrawWidth were 1. Figure 1.23 shows program StyleBox modified so DrawWidth is 5. |
|
|
|
|
|
|
|
|
FillStyle determines how a box or circle is filled. This property can take the following values. |
|
|
|
|
| |
|
|
|
|
Fills the object with the color specified by FillColor. |
|
|
|
| | |
|
|
|
|
Does not fill the object. |
|
|
|
| | |
|
|
|
|
Fills the object with horizontal lines. |
|
|
|
| | |
|
|
|
|
Fills the object with vertical lines. |
|
|
|
| | |
|
|
|
|
Fills the object with lines slanting upward from right to left. |
|
|
|
| | |
|
|
|
|
Fills the object with lines slanting downward from right to left. |
|
|
|
| | |
|
|
|
|
Fills the object with vertical and horizontal lines. |
|
|
|
| | |
|
|
|
|
Fills the object with lines slanting both upward and downward from right to left. |
|
|
|
|
|
|
|
|
|
|
Figure 1.21
Example program StyleBox demonstrates
Visual Basic's drawing styles. |
|
|
|
|
|